Skip to content

feat: add LocationService.createInputField method#833

Merged
2ndalpha merged 7 commits intomasterfrom
feat/create-input-field
Mar 30, 2026
Merged

feat: add LocationService.createInputField method#833
2ndalpha merged 7 commits intomasterfrom
feat/create-input-field

Conversation

@2ndalpha
Copy link
Copy Markdown
Member

@2ndalpha 2ndalpha commented Mar 26, 2026

Summary

  • Add LocationService.createInputField() — calls POST /input-fields with V2 header
  • Type-safe discriminated union covering all 9 input field types (TEXT, SELECT, EMAIL, PHONE_NUMBER, FIRST_NAME, LAST_NAME, URL, DATE, NUMERIC)
  • One interface per field type, extending a shared InputFieldBase
  • Extract shared V2_HEADERS constant reused by location and ticket services

Test plan

  • Unit tests for TEXT, SELECT, NUMERIC, and FIRST_NAME field creation
  • Integration tested against local server — all 9 field types, GraphQL verification, duplicate ID (409), non-existent location error

Add support for creating input fields via the public V2 API endpoint
POST /input-fields. Includes a type-safe discriminated union covering
all 9 input field types (TEXT, SELECT, EMAIL, PHONE_NUMBER, FIRST_NAME,
LAST_NAME, URL, DATE, NUMERIC) with per-type properties.
Follow existing one-type-per-file pattern (ticket-extra-option.ts,
opening-hours-time.ts, etc.) by splitting the monolithic
input-field-creation-request.ts into 16 individual files.
Replace inline { id: number } with named LocationRef and LineRef
interfaces in InputFieldBase, matching the server's ref pattern.
Move the duplicated V2 API version header into a shared v2-headers.ts
module, reused by both location and ticket services. Remove unused
InputFieldType. Add test for minimal FIRST_NAME field creation.
@2ndalpha 2ndalpha requested a review from KonradPaluch March 26, 2026 13:09
@2ndalpha 2ndalpha enabled auto-merge March 26, 2026 13:09
Comment thread packages/javascript-api/src/lib/services/location/location.ts Outdated
Comment thread packages/javascript-api/src/lib/services/location/location.service.ts Outdated
Comment thread packages/javascript-api/src/public-api/model.ts Outdated
@2ndalpha 2ndalpha added this pull request to the merge queue Mar 27, 2026
@KonradPaluch KonradPaluch removed this pull request from the merge queue due to a manual request Mar 27, 2026
@KonradPaluch KonradPaluch self-requested a review March 27, 2026 14:48
Remove duplicate JSDoc from implementation function, remove V2 header
implementation detail from service docs, and remove internal InputFieldBase
from public API exports.
@2ndalpha 2ndalpha added this pull request to the merge queue Mar 30, 2026
Merged via the queue into master with commit 053cdfc Mar 30, 2026
10 checks passed
@2ndalpha 2ndalpha deleted the feat/create-input-field branch March 30, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants